<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php include template('phpcms','header'); ?>
<script type="text/javascript" src="images/js/jqModal.js"></script>
<div id="main">
  <!--begin left-->
  <div id="main_l">
    <!--导航-->
    <div id="position"><a href="<?php echo $M['url'];?>">问吧首页</a>具体问题</div>
    <div class="cat">
      <h3 class="now"><?php if($status==5) { ?><span class="j_1">已解决</span><?php } elseif ($status==6) { ?><span class="j_1">已关闭</span><?php } else { ?><span class="j_2">未解决</span><?php } ?></h3>
      <div class="question"><?php echo $title;?></div>
      <div class="question_attribute">
  <?php if(!$isask && $status==3 && !$have_answer) { ?><a href="<?php echo URL;?>#answerdiv"><img src="<?php echo $M['url'];?>images/btn_answer.gif" alt="我要回答"/></a>&nbsp;<?php } ?>
  <?php if($status==5) { ?> 解决时间：<?php echo date('Y-m-d H:i',$solvetime);?> <?php } elseif ($status==3) { ?>离问题结束还有<span class="time"><?php echo $day;?>天<?php echo $hour;?>小时<?php echo $minute;?>分</span><?php } ?> <?php if($reward) { ?>悬赏：<span class="gold"><?php echo $reward;?></span><?php } ?></div>
      <div class="question_add" >
        <p><span id="askmessage"><?php echo $message;?></span></p>
      </div>
    </div>

    <!--最佳答案-->
<?php if($status==5) { ?>
    <div class="cat">
      <h3 class="good">最佳答案　<span>回答者： phpcms   一级  试用期 (0)     回复时间：<?php echo date('Y-m-d H:i',$answertime);?></span></h3>
      <div class="answer">
        <p><?php echo $answer;?></p>
      </div>
    </div>
<?php } ?>
    <!--其他答案-->
   <div class="cat">
<h3>其他回答<span>(<?php echo $answercount;?>)</span></h3>
<form name="voteForm" id="voteForm" action="" method="post" onSubmit="return ck_voteform();">
  <?php if(is_array($infos)) foreach($infos AS $info) { ?>
      <div class="answer_list">
        <ul>
          <li><span id="answermessage"><?php echo $info['message'];?></span></li>
          <li>
<?php if($status==3 && $userid==$_userid) { ?>
<input type="checkbox" name="check_answer[]"  value="<?php echo $info['pid'];?>" onclick="selnum+=checked?1:-1;ck_voteform();"/>候选
<?php } ?>
          </li>
          <li class="align_r">回答者：<?php echo $info['username'];?> <?php echo $info['actor'];?> 回复时间：<?php echo date('Y-m-d H:i',$info[addtime]);?></li>
        </ul>
      </div>
  <?php } ?>
<p>
<input type="submit" name="dosubmit" value="好了，转入投票流程" />
<input type="hidden" name="forward" value="<?php echo $forward;?>" />
<input type="button" value="返回" onclick="history.back(-1);"/> <span id="vote_msg"><font color='red'><strong>请选择至少两个备选答案.</strong></font></span></p>
</form>
</div>
  </div>
  <!--end left-->
  <!--begin right-->
  <div id="main_r">
    <h4>热点问题</h4>
    <div>
      <ul class="text_list">
       <?php echo tag('ask', 'tag_ask', "SELECT * FROM `phpcms_ask` WHERE status='3'  ORDER BY hits DESC", 0, 10, array (  'catid' => '0',  'userid' => '',  'flag' => '-1',  'action' => $action,  'urlruleid' => '29',  'class' => 'url',  'target' => '_blank',  'showcatname' => '0',  'titlelen' => '46',));?>
      </ul>
    </div>
    <h4>推荐问题</h4>
    <div class="text_list">
      <ul>
        <?php echo tag('ask', 'tag_ask', "SELECT * FROM `phpcms_ask` WHERE status='3'  AND catid='$catid' AND flag='3' ORDER BY askid DESC", 0, 10, array (  'catid' => $catid,  'userid' => '',  'flag' => '3',  'action' => $action,  'urlruleid' => '29',  'class' => 'url',  'target' => '_blank',  'showcatname' => '0',  'titlelen' => '46',));?>
      </ul>
    </div>
    <h4 class="tag_box">积分排行<span class="tag_menu_1"><a href="<?php echo $M['url'];?>creditlist.php?action=week" onMouseOver="showContent('0')" id="nav0">上周</a><a href="<?php echo $M['url'];?>creditlist.php?action=month" onMouseOver="showContent('1')" id="nav1">上月</a><a href="<?php echo $M['url'];?>creditlist.php?action=all" onMouseOver="showContent('2')" id="nav2" class="selected">总排行</a></span></h4>
    <div id="content0" style="display:none;">
      <ul class="text_list_1">
  <?php echo tag('ask', 'tag_credit', "SELECT m.userid,m.username,m.preweek AS point,i.lastlogintime,i.logintimes,i.actortype,i.answercount,i.acceptcount FROM `phpcms_ask_credit` m LEFT JOIN `phpcms_member_info` i ON m.userid=i.userid ORDER BY preweek DESC", 0, 10, array (  0 => '',  'class' => 'url',  'target' => '_blank',));?>
      </ul>
    </div>
<div id="content1" style="display:none;">
      <ul class="text_list_1">
  <?php echo tag('ask', 'tag_credit', "SELECT m.userid,m.username,m.premonth AS point,i.lastlogintime,i.logintimes,i.actortype,i.answercount,i.acceptcount FROM `phpcms_ask_credit` m LEFT JOIN `phpcms_member_info` i ON m.userid=i.userid ORDER BY premonth DESC", 0, 10, array (  0 => '',  'class' => 'url',  'target' => '_blank',));?>
      </ul>
    </div>
<div id="content2">
      <ul class="text_list_1">
  <?php echo tag('ask', 'tag_credit', "SELECT m.userid,m.username,m.point,i.lastlogintime,i.logintimes,i.actortype,i.answercount,i.acceptcount FROM `phpcms_member` m LEFT JOIN `phpcms_member_info` i ON m.userid=i.userid ORDER BY point DESC", 0, 10, array (  0 => '',  'class' => 'url',  'target' => '_blank',));?>
      </ul>
    </div>
  </div>
  <!--end right-->
</div>

<SCRIPT LANGUAGE="JavaScript">
<!--
function showContent(id)
{
for (var i = 0;i < 3;i++)
{
var nav = document.getElementById("nav" + i);
var content = document.getElementById("content" + i);
if (i == id)
{
nav.className = 'selected';
content.style.display = "";
}
else
{
nav.className = '';        
content.style.display = "none";
}
}
}
var selnum = 0;
function ck_voteform()
{
if(selnum >= 2)
{
$('#vote_msg').html('');
return true;
}
else
{
$('#vote_msg').html("<font color='red'><strong>请选择至少两个备选答案.</strong></font>");
return false;
}
}
//-->
</SCRIPT>
<!--end main-->
<!--begin foot-->
<?php include template('phpcms','footer'); ?>